package com.dailyblue.javaee.controller;


import com.dailyblue.javaee.service.EmpService;
import com.dailyblue.javaee.service.impl.EmpServiceImpl;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;
import java.io.PrintWriter;

@WebServlet("/emp_find_page_number_ajax")
public class EmpFindPageNumberAjaxController extends HttpServlet {

    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        EmpService service = new EmpServiceImpl();
        int pageNum = service.findAllPageNum();
        PrintWriter out = response.getWriter();
        out.println(pageNum);
    }
}